import asynchronous from "./Asynchronous.js";
import Instance from "./Instance.js"
import Crops from "./Crops.js";

const keyprompt = {


    update: function () {

    },

    onLayoutStart() {

        keyprompt.doFade = false;
        keyprompt.TextInstance = Instance.GetPickInstance("KeyPrompt")
        keyprompt.recordLastObjectc = null;

        
        

    },


   
    showKeyPrompt: function (obj = null, x, y, key, todo) {

       
      

            this.FadeIn(obj,0.5)

            keyprompt.TextInstance.x = x
            keyprompt.TextInstance.y = y
            keyprompt.TextInstance.text = "Press" + "[color=yellow]  " + key + "[/color]" + " [color=white]" + todo + "[/color]"

        keyprompt.recordLastObjectc = obj;

         
    },

  

    RebackKeyPrompt: function () {

        keyprompt.TextInstance.x = -100
        keyprompt.TextInstance.y = -100

    },

    async FadeIn(obj,time) {

        if (obj != keyprompt.recordLastObjectc || keyprompt.recordLastObjectc == null) {
            rt.callFunction("keyPeomptFadeIn", time)
        }

       

       


    }

}
export default keyprompt